package com.bowen.spike.task;


import java.util.concurrent.*;

/**
 * 异步执行任务类
 */
public class AsynchronousTask {

    private static final ExecutorService EXECUTOR_SERVICE;

    static {
        EXECUTOR_SERVICE = new ThreadPoolExecutor(8,
                17, 1,
                TimeUnit.MINUTES, new LinkedBlockingDeque<>(),
                Executors.defaultThreadFactory());
    }

    public static void addTask(Runnable runnable) {
        EXECUTOR_SERVICE.execute(runnable);
    }


}
